from django.shortcuts import render, reverse
from django.http import HttpResponse


# Create your views here.

# GET /users/say
def say(request):
    return HttpResponse('say')


# GET /users/sayhello
def say_hello(request):
    return HttpResponse('say hello')


# http://127.0.0.1:8000/users/index/
def index(request):
    """
    需求: 演示路由和视图的匹配
    :param request: 视图至少要有一个参数,并且放在第一位,接收请求对象(HttpRequest类型对象) 内部包含请求报文信息
    :return: 响应对象 (HttpResponse类型对象) 内部包含响应报文信息
    """
    url = reverse('users:reverse_demo')
    print(url)

    return HttpResponse("hello django")
